package com.authine.cloudpivot.ext.util;

import com.authine.hermes.app.file.feign.FtpFeignServiceI;
import com.authine.mvp.app.launcher.config.PropertiesConfig;
import com.authine.mvp.app.launcher.domain.utills.ApplicationContextUtils;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @program: gm-market
 * @description:
 * @author: wlw
 * @create: 2021-08-17 14:35
 **/
@Slf4j
@Component
@Lazy
public class CommonService {
    private static Map<String,Object> map = Maps.newHashMap();
    {
        map.put("jdbcTemplate",ApplicationContextUtils.getBean(JdbcTemplate.class));
        map.put("propertiesConfig",ApplicationContextUtils.getBean(PropertiesConfig.class));
        map.put("ftpFeignServiceI",ApplicationContextUtils.getBean(FtpFeignServiceI.class));

    }
    public static Object get(String key){
        return map.get(key);
    }

}
